import request from '@/config/axios'

export interface StoreVO {
  id: number
  code: string
  agentCode: string
  name: string
  workBusinessBeginTime: string
  workBusinessEndTime: string
  weekendBusinessBeginTime: string
  weekendBusinessEndTime: string
  longitude: string
  latitude: string
  address: string
  status: string
}

// 查询门店分页
export const getStorePage = async (params) => {
  return await request.get({ url: `/meijia/store/page`, params })
}

// 查询门店详情
export const getStore = async (id: number) => {
  return await request.get({ url: `/meijia/store/get?id=` + id })
}

// 新增门店
export const createStore = async (data: StoreVO) => {
  return await request.post({ url: `/meijia/store/create`, data })
}

// 修改门店
export const updateStore = async (data: StoreVO) => {
  return await request.put({ url: `/meijia/store/update`, data })
}

// 删除门店
export const deleteStore = async (id: number) => {
  return await request.delete({ url: `/meijia/store/delete?id=` + id })
}

// 导出门店 Excel
export const exportStore = async (params) => {
  return await request.download({ url: `/meijia/store/export-excel`, params })
}
// 查询门店详情
export const getByAgentCodeContainNull = async (params) => {
  return await request.get({ url: `/meijia/store/get-by-agent-code`,params })
}
// 查询门店详情
export const getStoreOwnerList = async () => {
  return await request.get({ url: `/meijia/store/get-store-owner-list` })
}